SET.FETCH_PREV Function

Syntax

Found_Flag as L = Fetch_Prev([fetch level])

Arguments

level

Optional. Used when fetching through the records of a set. The outline level determines the depth of the fetch, so that tables at lower levels in the set can be excluded from the Fetch operation.

Description

Fetch the previous record in the table/set. returns TRUE if record found.

Discussion

The .FETCH_PREV() method retrieves the previous record in the set referenced by . The previous record is determined by the active range, index, or query list. If there is no previous record to be fetched, the method returns a value other than zero. Use the <SET>.FETCH_EOF() method after every .FETCH_PREV()to determine if the function has tried to fetch beyond the active range and index. In most cases, the last current record is preserved when a .FETCH_PREV()fails. You use the optional Outline_Level_Number parameter when fetching through the records of a set. The outline level determines the depth of the fetch, so that tables at lower levels in the set can be excluded from the Fetch operation. This is useful for operations that relate to only parent records in a set. For more information, see Fetching at a Particular Level in a Set.

Example

The following example fetches the previous record of the set and displays the description field from the primary table.

dim tset as P
dim tbl as P
tset = set.open("inventory")
tset.fetch_last()
tset.fetch_prev()
? tbl.description
= "Water Pistol

See Also